<?php

class Reale_Model_Estate_Project extends Reale_Model_Estate_Generic
{
	/**
	 * 
	 * Stores project's name
	 * @var string
	 */
	protected $_project_name;
	
	/**
	 * 
	 * Stores project's builder
	 * @var string
	 */
	protected $_builer;
	
	/**
	 * 
	 * Stores project's area covered
	 * @var double
	 */
	protected $_area;
	
	
	/**
	 * 
	 * Stores enquiry entity mapper
	 * @var Reale_Model_ProjectMapper
	 * 
	 */
	protected $_mapper;
	
	/**
	 * 
	 * Setter function for project name
	 * @param string project_name 
	 */
	public function setProject_name($project_name) {
		$this->_project_name = $project_name;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for project name
	 * @return string project_name
	 */
	public function getProject_name() {
		return $this->_project_name;	
	}

	/**
	 * 
	 * Setter function for builder
	 * @param string builer 
	 */
	public function setBuilder($builder) {
		$this->_builder = $builder;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for builder
	 * @return string builder
	 */
	public function getBuilder() {
		return $this->_builder;	
	}
	
	/**
	 * 
	 * Setter function for area
	 * @param double area
	 */
	public function setArea($area) {
		$this->_area = $area;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for area
	 * @return double area
	 */
	public function getArea() {
		return $this->_area;	
	}
	
	/**
	 * 
	 * Setter function for project mapper 
	 * @param Reale_Model_ProjectMapper
	 */
	public function setMapper($mapper) {
		$this->_mapper = $mapper;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for enquiry mapper
	 * @return Reale_Model_Estate_ProjectMapper $_mapper
	 */
	public function getMapper(){
        if (null === $this->_mapper) {
            $this->setMapper(new Reale_Model_Estate_ProjectMapper());
        }
        return $this->_mapper;
    }
    
  	
    /**
     * 
     * To save new or update existing project's informtion.
     * return bool
     * 
     */
    public function save() {
    	$return = $this->getMapper()->save($this);
    	if ($return) {
    	    /* I think not need as mapper accepts &$this
        	if ($return instanceof Reale_Model_Estate_Property) {
        		$this->setEstate_id($return->getEstate_id());
        	}*/
        	return true;
    	}
    	return null;
    } 
    
}

